home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Answers 2002 January
/
PC Answers January 2002.7z
/
PC Answers January 2002.bin
/
graphics
/
freepixl
/
_SETUP.1
/
dlgsampl.pxl
< prev
next >
Wrap
Text File
|
2000-12-23
|
5KB
|
137 lines
{ PiXCL Code fragments for the DialogBox command:
Fdx1, Fdy1 are the TL corner coords for the dialogs created by the subroutines }
{
NewFileCreateDlg: {subroutine}
Fdx2 = Fdx1 + 180
Fdy2 = Fdy1 + 70
List$ = "blank 8 bit Feature file|blank 24 bit Feature file|blank Theme file|Feature PAL file|Theme PAL file"
DialogBox(Fdx1,Fdy1,Fdx2,Fdy2,"Create a new file",CAP_NCTR, 5,5,32,32,ICON07,
143,28,178,43,"&OK",2,Res, {0 = OK}
143,48,178,63,BTN,PUSH,"&Cancel", {1 = Cancel}
20,5,140,68,LIST,MULTI,List$,Selection$)
{do something with the selection}
Return
NormalizerRange:
WaitInput(1)
LoRange$ = "20" HiRange$ = "220"
Fdx1 = 100 Fdy1 = 40
FunctionDialogTitle$ = "Set Normalize Range Values"
GoSub ShowFunctionDialog2 {returns FDRes}
If FDRes = 1
Val(LoRange$,LoRange,Res)
Val(HiRange$,HiRange,Res)
NormalizeImageRange(LoRange,HiRange,Res)
If Res <> 0 Then ZoomBitmapWindow(Bmw1,ImageFile$,0,0,0,INCREMENT)
If HistogramFlag = 1 Then GoSub DisplayRGBChannelHistograms
Endif
Goto Wait_for_Input
GammaCorrector:
WaitInput(1)
HiRange$ = "220"
MidRange$ = "220"
LoRange$ = "220"
Fdx1 = 100 Fdy1 = 40
FunctionDialogTitle$ = "Set Gamma Values (x100)"
GoSub ShowFunctionDialog3 {returns FDRes}
If FDRes = 1
Val(HiRange$,RedGamma,Res)
Val(MidRange$,GreenGamma,Res)
Val(LoRange$,BlueGamma,Res)
GammaCorrectImage(RedGamma,GreenGamma,BlueGamma,Res)
If Res <> 0 Then ZoomBitmapWindow(Bmw1,ImageFile$,0,0,0,INCREMENT)
If HistogramFlag = 1 Then GoSub DisplayRGBChannelHistograms
Endif
Goto Wait_for_Input
{Following sample dialogs are often usable in programs. The title is set by
FunctionDialogTitle$ and the TLcorner position in the application client are
set by Fdx1 and Fdx2.
The return variables are
FDres - returns the button code: 0 for Cancel, 1 for OK,
InputValue$, LoRange$, MidRange$, HiRange$
These four strings have to be converted by your PiXCL code into the
desired integer variables. }
ShowFunctionDialog1: {subroutine: one numeric input }
Fdx2 = Fdx1 + 150
Fdy2 = Fdy1 + 50
DialogBox(Fdx1, Fdy1,Fdx2,Fdy2,FunctionDialogTitle$,CAP_NCTR,
5,15,24,24,QUESTION,
110,25,145,40,"&Cancel",4,FDRes, {returns 0}
110,5,145,20,BTN,PUSH,"&OK", {returns 1}
20,5,105,45,BTN,GROUP,"Numeric Input", {edit string}
48,23,100,33,STATIC,LEFT,"Input value", {edit string}
25,17,45,27,EDIT,NUMBER,InputValue$,InputValue$)
Return
ShowFunctionDialog2: {subroutine: two numeric inputs}
Fdx2 = Fdx1 + 150
Fdy2 = Fdy1 + 50
DialogBox(Fdx1, Fdy1,Fdx2,Fdy2,FunctionDialogTitle$,CAP_NCTR,
5,15,24,24,QUESTION,
110,25,145,40,"&Cancel",6,FDRes, {returns 0}
110,5,145,20,BTN,PUSH,"&OK", {returns 1}
20,5,105,45,BTN,GROUP,"Numeric Input", {edit string}
48,17,100,27,STATIC,LEFT,"High range value", {edit string}
25,17,45,27,EDIT,NUMBER,HiRange$,HiRange$,
48,29,100,39,STATIC,LEFT,"Low range value", {edit string}
25,29,45,39,EDIT,NUMBER,LoRange$,LoRange$)
Return
ShowFunctionDialog3: {subroutine: three numeric inputs}
Fdx2 = Fdx1 + 150
Fdy2 = Fdy1 + 65
DialogBox(Fdx1, Fdy1,Fdx2,Fdy2,FunctionDialogTitle$,CAP_NCTR,
5,15,24,24,QUESTION,
110,35,145,50,"&Cancel",8,FDRes, {returns 0}
110,15,145,30,BTN,PUSH,"&OK", {returns 1}
20,5,105,55,BTN,GROUP,"Numeric Input", {edit string}
48,17,100,27,STATIC,LEFT,"High range value", {edit string}
25,17,45,27,EDIT,NUMBER,HiRange$,HiRange$,
48,29,100,39,STATIC,LEFT,"Mid range value", {edit string}
25,29,45,39,EDIT,NUMBER,MidRange$,MidRange$,
48,41,100,51,STATIC,LEFT,"Low range value", {edit string}
25,41,45,51,EDIT,NUMBER,LoRange$,LoRange$)
Return
UserIDPasswordBox: {subroutine}
Fdx2 = Fdx1 + 230
Fdy2 = Fdy1 + 90
Msg$ = "Please enter your UserID and Password"
Info$ = "Information"
MoreInfo$ = "User IDs and Passwords are automatically checked by the Server. Once verified you will be logged into your secure user account."
DialogBox(Fdx1,Fdy1,Fdx2,Fdy2,"Custom Password Box using DialogBox command", CAP_NCTR,
350,110, 64,64, WINLOGO,
170,35,220,50,"&OK", 6, Res,
170,15,220,30,BTN,PUSH,"&Cancel",
25,2,165,18,STATIC, LEFT, Msg$ ,
4,17,160,30,EDIT,STRING,"",UserID$,
4,37,160,50,EDIT,PASSWORD,"",Pwd$,
4,52,160,88,BTN,GROUP,Info$,
6,60,158,87,STATIC,LEFT,MoreInfo$)
Return
ShowListingControl: {subroutine}
Fdx2 = Fdx1 + 210
Fdy2 = Fdy1 + 160
Msg$ = "Fill this string with the initial text, eg with FileRead_ASCII"
DialogBox(Fdx1,Fdy1,Fdx2,Fdy2,"Edit Control Dialog Box", CAP_NCTR,
15,25, 48,48, ICON01,
30,145,80,158,"&Cancel", 2, Res,
130,145,180,158,BTN, PUSH,"&OK",
5,5,205,143,EDIT,MLSTRING,Msg$,Res2$)
Return
}